
package cn.xabad.commons.io.input;

import java.io.IOException;
import java.io.InputStream;


public class BrokenInputStream extends InputStream {

    
    private final IOException exception;

    
    public BrokenInputStream(IOException exception) {
        this.exception = exception;
    }

    
    public BrokenInputStream() {
        this(new IOException("Broken input stream"));
    }

    
    @Override
    public int read() throws IOException {
        throw exception;
    }

    
    @Override
    public int available() throws IOException {
        throw exception;
    }

    
    @Override
    public long skip(long n) throws IOException {
        throw exception;
    }

    
    @Override
    public void reset() throws IOException {
        throw exception;
    }

    
    @Override
    public void close() throws IOException {
        throw exception;
    }

}
